home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / web / spiderweb / fixes-to-be-applied / fixes < prev   
Internet Message Format  |  1992-01-22  |  5KB

  1. From patrick%cs.kuleuven.ac.be@princeton.edu Thu Aug 29 01:20:59 1991
  2. Return-Path: <patrick%cs.kuleuven.ac.be@princeton.edu>
  3. Received: from alpha.xerox.com by palain.PARC (4.1/SMI-4.1)
  4.     id AA13556; Thu, 29 Aug 91 01:20:57 PDT
  5. Received: from Minos.PARC.Xerox.xns by alpha.xerox.com via XNS id <11523>; Thu, 29 Aug 1991 01:20:32 PDT
  6. Received: from Princeton.EDU ([128.112.128.1]) by alpha.xerox.com with SMTP id <11523>; Thu, 29 Aug 1991 01:20:05 PDT
  7. Received: from fs.Princeton.EDU by Princeton.EDU (5.65b/2.80/princeton)
  8.     id AA15585; Thu, 29 Aug 91 04:19:59 -0400
  9. Received: from Princeton.EDU (Princeton.EDU.) by fs.Princeton.EDU (4.0/1.105)
  10.     id AA08885; Thu, 29 Aug 91 04:19:57 EDT
  11. Received: from n-kulcs.cs.kuleuven.ac.be by Princeton.EDU (5.65b/2.80/princeton)
  12.     id AA15582; Thu, 29 Aug 91 04:19:49 -0400
  13. Received: from medusa.cs.kuleuven.ac.be by n-kulcs.cs.kuleuven.ac.be (5.64+/n_kulcs1.1)
  14.     id AA02072; Thu, 29 Aug 91 10:20:48 +0200
  15. Received: by medusa.cs.kuleuven.ac.be (5.65b/cs_kuleuven.02)
  16.     id AA08766; Thu, 29 Aug 91 10:21:14 +0200
  17. X-Ns-Transport-Id: 08002008D0FD000FC327
  18. Date:     Thu, 29 Aug 1991 01:21:14 PDT
  19. From: patrick%cs.kuleuven.ac.be@princeton.edu (Patrick Weemeeuw)
  20. Subject: Spidery Web
  21. To: nr@princeton.edu
  22. Message-Id: <9108290821.AA08766@medusa.cs.kuleuven.ac.be>
  23. Status: RO
  24.  
  25. Hello,
  26. I'm trying to develop a web system for Prolog.
  27.  
  28. One of the difficulties I had is recognizing tokens containing
  29. backslashes. I changed master/spider.web such that it now correctly
  30. handles tokens like:
  31. token \\== category ....
  32. generating the C string "\\==" but checking for a string with lenght *3*
  33. instead of 4.
  34.  
  35. The context diff is included below.
  36.  
  37. Patrick.
  38. --
  39. Patrick Weemeeuw                   mail: Katholieke Universiteit Leuven
  40. Tel: +32 16 200656 x 3544                Dept. of Computer Science     
  41. e-mail: patrick@cs.kuleuven.ac.be        Celestijnenlaan 200 A         
  42. Fax: +32 16 205308             B-3001 Leuven (Belgium)       
  43. ======================================================================
  44.  
  45.  
  46. *** spider.web    Wed Aug 28 19:32:01 1991
  47. --- spider.web.orig    Wed Aug 28 17:47:57 1991
  48. ***************
  49. *** 794,800
  50.       tokenname[$2]="SP_gen_token_" tokennumber
  51.       tokennumbers[$2]=tokennumber
  52.       tokennumber--
  53. -     #<Find real length of |$2| and put it in |tokenlength[$2]|#>
  54.       ## figure out how to recognize the token
  55.       temp = sprintf( "strncmp(\"%s\",loc-1,%d)==0", $2, tokenlength[$2])
  56.       tokentest[$2]=temp
  57.  
  58. --- 794,799 -----
  59.       tokenname[$2]="SP_gen_token_" tokennumber
  60.       tokennumbers[$2]=tokennumber
  61.       tokennumber--
  62.       ## figure out how to recognize the token
  63.       temp = sprintf( "strncmp(\"%s\",loc-1,%d)==0", $2, length($2))
  64.       tokentest[$2]=temp
  65. ***************
  66. *** 796,802
  67.       tokennumber--
  68.       #<Find real length of |$2| and put it in |tokenlength[$2]|#>
  69.       ## figure out how to recognize the token
  70. !     temp = sprintf( "strncmp(\"%s\",loc-1,%d)==0", $2, tokenlength[$2])
  71.       tokentest[$2]=temp
  72.   
  73.   # To find the length of a string considered as a C~string, we scan it looking
  74.  
  75. --- 795,801 -----
  76.       tokennumbers[$2]=tokennumber
  77.       tokennumber--
  78.       ## figure out how to recognize the token
  79. !     temp = sprintf( "strncmp(\"%s\",loc-1,%d)==0", $2, length($2))
  80.       tokentest[$2]=temp
  81.       tokenlength[$2]=length($2)
  82.   
  83. ***************
  84. *** 798,803
  85.       ## figure out how to recognize the token
  86.       temp = sprintf( "strncmp(\"%s\",loc-1,%d)==0", $2, tokenlength[$2])
  87.       tokentest[$2]=temp
  88.   
  89.   # To find the length of a string considered as a C~string, we scan it looking
  90.   for occurrences of the \.{\\} character. We initialize |templ| with
  91.  
  92. --- 797,803 -----
  93.       ## figure out how to recognize the token
  94.       temp = sprintf( "strncmp(\"%s\",loc-1,%d)==0", $2, length($2))
  95.       tokentest[$2]=temp
  96. +     tokenlength[$2]=length($2)
  97.   
  98.   
  99.   # The setting of attributes is as for all tokens:
  100. ***************
  101. *** 799,827
  102.       temp = sprintf( "strncmp(\"%s\",loc-1,%d)==0", $2, tokenlength[$2])
  103.       tokentest[$2]=temp
  104.   
  105. - # To find the length of a string considered as a C~string, we scan it looking
  106. - for occurrences of the \.{\\} character. We initialize |templ| with
  107. - |length($2)|, and each time we find a legitimate escape sequence, we decrement
  108. - |templ|. Remark that, given the current lexical analysis, \.{\\f}, \.{\\n} etc.
  109. - cannot occur in a token.
  110. - #<Find real length of |$2| and put it in |tokenlength[$2]|#>=
  111. -     templ=length($2)
  112. -     i=1 #/
  113. -     while(i<=length($2)) { #/
  114. -       if(substr($2,i,1)=="\\") { #/
  115. -           if(i<length($2)) {
  116. -           tempc=substr($2,i+1,1) #/
  117. -           if((tempc=="a") || (tempc=="b") || (tempc=="\\") || (tempc=="?") || (tempc=="'")) {
  118. -             templ--
  119. -             i++
  120. -           } else { #/
  121. -             i++ #/
  122. -           } #/
  123. -           } #/
  124. -       } #/
  125. -     i++ #/
  126. -     } #/
  127. -     tokenlength[$2]=templ
  128.   
  129.   # The setting of attributes is as for all tokens:
  130.   #<Set attributes of token |$2|#>=
  131.  
  132. --- 799,804 -----
  133.       tokentest[$2]=temp
  134.       tokenlength[$2]=length($2)
  135.   
  136.   
  137.   # The setting of attributes is as for all tokens:
  138.   #<Set attributes of token |$2|#>=
  139.  
  140.